package org.jeecg.modules.demo.crm.mapper;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.demo.crm.entity.CProjectHeadQuotes;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: 总项目报价表
 * @Author: jeecg-boot
 * @Date:   2025-06-19
 * @Version: V1.0
 */
public interface CProjectHeadQuotesMapper extends BaseMapper<CProjectHeadQuotes> {


    @Select("select * from c_project_head_quotes  where project_id=#{projectId} and status='审核中'")
    List<CProjectHeadQuotes> findByProjectHead(@Param("projectId")String projectId);

    @Select("select IFNULL(sum(quote),0) from c_project_head_quotes  where project_id =#{projectId}   ORDER BY quotes_time desc limit 1")
    BigDecimal totalProjectQuotation(@Param("projectId")String projectId);


}
